unit DLLStruct;

interface

uses Sharemem, Messages, Classes, Types, ADODB;

const
  WM_QUERYINSURANCE_INVALIDATE = WM_USER + 1;
  WM_REFRESHREFERRAL           = WM_USER + 2;
  WM_REFRESHAUTHORIZATION      = WM_USER + 3;
  PATIENTINSURANCETABFORMS     = 'PatientInsuranceTabForms.dll';


type

  TFormMode    = (fmEdit, fmFind, fmNew);

  TPolicyVars = record
    Policy: Integer;
    MainHandle: Integer;
    PatientID: LongInt;
    FirstName: string;
    LastName: string;
    ComputerName: string;
    ClientName: String;
    StaffKey: Integer;
  end;



  TReferralVars = record
    PatientKey: LongInt;
    Referral: Integer;
    MainHandle: Integer;
    FirstName: string;
    LastName: string;
    ComputerName: string;
    ClientName: String;
    StaffKey: Integer;
  end;

  TAuthorizationVars = record
    Authorization: Longint;
    PatientKey: Integer;
    MainHandle: Integer;
    ComputerName: string;
    ClientName: String;
    StaffKey: Integer;
  end;

 //ODoffice changes - sarma
  TProductBrandVars = record
   ProductBrandKey :integer;
   ProductBrandName:String;
  end;
 //ODoffice changes - sarma

 TSecurityVars = record
    ClientKey: Integer;
    ComputerName: String;
    SQLServerName: String;
    SQLDBName: String;
    SQLPassword: String;
    SQLUserName: String;
    ClientName: String;
    BDEAlias: String;
    bDCOMCon: Boolean;
    nStaffKey: Integer;
    //Added for ONC; by Shyam. Added here for more Staff Details
    nStaffName: String;
    nStaffSystemLoginTime: TDateTime;
    nRoleIDCode: Integer;
    MachineName: String;
  end;

  //Added for ONC; by Shyam.
  TPatientInfo = record
    PatientKey: Integer;
    Name: String;
    BirthDate: TDateTime;
    Gender: String;
    Address: String;
    Account: Integer;
  end;
  //Added for ONC; by Shyam.

  TPlanVars = record
    FormMode: TFormMode;
    Planskey: String;
    PatientKey: Integer;
    MainHandle: Integer;
    StaffKey: Integer;
    SecVars: TSecurityVars;
    PatInfo: TPatientInfo;    //Added PatientInfo for ONC; by Shyam.
  end;

  TPlanFinderVars = record
    FormMode: TFormMode;
    Planskey: LongInt;
    PatientKey: Integer;
    MainHandle: Integer;
    StaffKey: Integer;
    SecVars: TSecurityVars;
    PatInfo: TPatientInfo;    //Added PatientInfo for ONC; by Shyam.
  end;

  TESuperbillVars = record
    ProviderKey: LongInt;
    ReasonKey: LongInt;
    SheduleKey: LongInt;
    StaffKey: Integer;
    Coord: TPoint;
    MainHandle: Integer;
    TargetFormHandle: Integer;
    SecVars: TSecurityVars;
  end;

  TESuperbillRetVals = record
    DiagnosisKey: String;
    ProcedureKey: String;
  end;

  TDiagKeys = record
    DiagKey1: LongInt;
    DiagKey2: LongInt;
    DiagKey3: LongInt;
    DiagKey4: LongInt;
  end;

  TProcKeys = record
    ProcKey: LongInt;
  end;

  TMedicationKeys = record
    MedicationKey: LongInt;
  end;

  TDiagFinderVars = record
    DiagKey1: LongInt;
    DiagKey2: LongInt;
    DiagKey3: LongInt;
    DiagKey4: LongInt;
    StaffKey: Integer;
    Coord: TPoint;
    SecVars: TSecurityVars;
    PatInfo: TPatientInfo;    //Added PatientInfo for ONC; by Shyam.
  end;

  TProcFinderVars = record
    ProcKey: LongInt;
    StaffKey: Integer;
    Coord: TPoint;
    SecVars: TSecurityVars;
    PatInfo: TPatientInfo;    //Added PatientInfo for ONC; by Shyam.
  end;

  TMedicationFinderVars = record
    MedicationKey: LongInt;
    StaffKey: Integer;
    Coord: TPoint;
    SecVars: TSecurityVars;
    PatInfo: TPatientInfo;    //Added PatientInfo for ONC; by Shyam.
  end;

  TReferringFinderVars = record
    FormMode: TFormMode;
    ReferralKey: LongInt;
    PatientKey: Integer;
    MainHandle: Integer;
    StaffKey: Integer;
    SecVars: TSecurityVars;
    PatInfo: TPatientInfo;    //Added PatientInfo for ONC; by Shyam.
  end;

 TPhraseFinderVars = record
    FormMode: TFormMode;
    Phrasekey: LongInt;
    PatientKey: Integer;
    MainHandle: Integer;
    StaffKey: Integer;
    SecVars: TSecurityVars;
    PatInfo: TPatientInfo;    //Added PatientInfo for ONC; by Shyam.
  end;


  TShowPlans               = function(PlanVars:TPlanVars; fADOConn: TADOConnection):string;
  TShowPlanFinder          = function(PlanFinderVars: TPlanFinderVars; fADOConn: TADOConnection):LongInt;
  TShowDiagFinder          = function(DiagFinderVars: TDiagFinderVars; FindBy: String; ADOConDLL : TADOConnection):TDiagKeys;
  TShowDiagFinder2         = function(DiagFinderVars: TDiagFinderVars; FindBy: String;Showmenu:Boolean; ADOConDLL : TADOConnection):TDiagKeys;
  TShowReferringFinder     = function(fADOConn: TADOConnection; ReferringFindersVars: TReferringFinderVars; FindBy: String):LongInt;
  TShowReferringFinder2    = function(fADOConn: TADOConnection; ReferringFindersVars: TReferringFinderVars; FindBy: String;Showmenu:Boolean):LongInt;
  TShowProcFinder          = function(ProcFinderVars: TProcFinderVars; FindBy: String; ADOConnDLL:TADOConnection):TProcKeys;
  TShowProcFinder2         = function(ProcFinderVars: TProcFinderVars; FindBy: String;ShowMenu:Boolean; ADOConnDLL:TADOConnection):TProcKeys;
  TShowMedicationFinder    = function(MedicationFinderVars: TMedicationFinderVars; Findby : String; Showmenu:Boolean; _ADOConnection: TADOConnection): TMedicationKeys;
  TShowMedicationFinder2   = function(MedicationFinderVars: TMedicationFinderVars; FindBy: String;Showmenu:Boolean; fADOCOnn: TADOConnection): TMedicationKeys;
  TShowPolicyForm          = procedure(PVars: TPolicyVars; SVars: TSecurityVars); StdCall;
  TShowReferralForm        = procedure(RVars: TReferralVars; SVars: TSecurityVars); StdCall;
  TShowAuthorizationForm   = procedure(AVars: TAuthorizationVars; SVars: TSecurityVars); StdCall;
  TShowElectronicSuperbill = procedure(EVars: TESuperbillVars);
  TShowPhraseFinder        = function(PhraseFinderVars: TPhraseFinderVars; FindBy: String; fADOConn: TADOConnection):LongInt;

  // callback functions...
  TCallBackNoParamProc  = procedure; StdCall;
  TCallBackIntParamProc = procedure(i: integer); StdCall;
  TCallBackStrParamProc = procedure(s: PChar); StdCall;

implementation

end.

